﻿using LowCoding.Application.Sys.Test;
using LowCoding.Common;
using LowCoding.Domain;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace LowCoding.API.Controllers.sys.Test
{
    [Route("api/[controller]")]
    [ApiController]
    public class TestController : BaseController
    {
        readonly IBaseDatatable _baseDatatable;
        readonly ITestService _testService;
        public TestController(IBaseDatatable baseDatatable, ITestService testService)
        {
            _baseDatatable = baseDatatable;
            _testService = testService;
        }
        [Route("Builde"),HttpGet]
        public void AddTable()
        {
             _baseDatatable.DataBase();
        }
        [Route("GetTestList"),HttpGet]
        [AllowAnonymous]
        public async Task<ResponseMessageModel> GetTestList()
        {
            var list = await _testService.GetTestList();
            return Success(list);
        }
    }
}
